﻿@{
    ViewBag.Title = "AgentInfo";
}

@section scripts
{
    <script src="@Url.Content("~/Scripts/shared/share.js")" type="text/javascript"></script> 
}

<form id="form1" method="post">
            @Html.Partial("~/Views/Modular/Toolbars.cshtml")
        <div name="Base" title="服务商资料" style="height:100%;overflow:hidden;margin-top:15px;margin-left:20px">
            <table style="width:100%;">
                <tr>
                    <td width="80px" height ="50px" align="right">
                        编 码：</td>
                    <td width="190px" height ="50px">
                        <input name="FNumber" id="FNumber" class="mini-textbox" enabled="false" style="width:190px;" required="true" value="" TabIndex="1"/>
                    </td>
                    <td width="80px" height ="50px" align="right">
                       联系电话：</td>
                    <td width="190px" height ="50px">
                        <input name="FTelephone" id="FTelephone" class="mini-textbox" style="width:190px;"  value="" TabIndex="5"/>
                    </td>
                </tr>
                <tr>
                    <td width="80px" height ="50px" align="right">
                        名 称：</td>
                    <td width="200px" height ="50px">
                        <input id="FName" name="FName" class="mini-textbox " style="width:190px;"  TabIndex="2"/>
                    </td>
                     <td width="80px" height ="50px" align="right">
                        &nbsp;&nbsp;EMail：</td>
                    <td width="190px" height ="50px">
                        <input name="FEmail" id="FEmail" class="mini-textbox" style="width:190px;"  value="" TabIndex="6"/>
                    </td>
               </tr>
                <tr>
                    <td width="80px" height ="50px" align="right">
                        联系人：</td>
                    <td width="200px" height ="50px">
                        <input id="FManager" name="FManager" class="mini-textbox "  style="width:190px;"  TabIndex="3"/>
                    </td>
                    <td width="80px" height="30px" align="right">分服务器：</td>
                    <td width="190px" height="30px">
                        <input id="FClusterID" name="FClusterID" class="mini-combobox" style="width:190px;"  value="1" />
                    </td>
                </tr>
                <tr>
                    <td width="80px" height ="50px" align="right">
                       联系地址：</td>
                    <td width="200px" height ="50px">
                        <input id="FAddress" name="FAddress" class="mini-textbox "  style="width:190px;"  TabIndex="4"/>
                    </td>
                    <td width="80px" height ="50px" align="right">
                       </td>
                    <td width="200px" height ="50px">
                       
                    </td>
                </tr>
            </table>
            <br />
        </div>
    <input name="FItemID" class="mini-hidden" />
</form>


<script>
    FormShown();
    function FormShown() {
        mini.parse();
        mini.get("FClusterID").setUrl('../Corp/getCluster?mSystemAppID=' + parent.window.getSystemAppID());
    }

    //加载资料
    function SetInfoData(data) {
        var form = new mini.Form("form1");        
        form.setData(data);
    }

    //保存资料
    function SaveInfo() {
        mini.getbyName("SaveInfo").disable();
        var form = new mini.Form("#form1");
        form.validate();
        if (form.isValid() == false) {
            mini.getbyName("SaveInfo").enable();
            return;
        }
        var data = form.getData(true, false);

        var json = mini.encode(data);
        $.post("SaveAgentInfo", { json: json}, function (data) {
            var ret = mini.decode(data);
            if (ret.status == 1) {
                mini.showTips({ content: ret.msg, state: "success", x: "center", y: "top", timeout: 3000 });
                NewInfo();
            }
            else {
                mini.alert("异常:" + ret.error);
            }
            mini.getbyName("SaveInfo").enable();
        });
    }

</script>